﻿#include<list>
#include "cv.h"

using std::list;

//class RectATM
struct SOptImg
{
    CvRect optRect;
    IplImage *img;
    time_t time;
};

struct SRectPic
{
    CvRect backRect;
    int count;
    bool flag;
    bool bSend;
    SOptImg optPic;
};

class CRectMatch
{
public:
    CRectMatch(int x,int y);
    void print();
    void UpDate(list<SOptImg>&alarmImg);
    int match(list<CvRect>&vR,IplImage *pImg,time_t time ,list<SOptImg>&alarmImg);
    bool compare(CvRect &rect1, CvRect &rect2);
    int getOptRect(CvRect &rect1,CvRect &rect2);
private:
    list<SRectPic> rectsATM;
    list<SRectPic> tempRects;
    int centerX;
    int centerY;
};
